package com.zx.zxblog.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zx.zxblog.entity.pojo.Tag;
import com.zx.zxblog.entity.query.BaseQuery;
import com.zx.zxblog.entity.vo.TagVO;
import com.zx.zxblog.mapper.TagMapper;
import com.zx.zxblog.service.TagService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * className=TagServiceImpl
 * package=com.zx.zxblog.service.Impl
 * description:
 *
 * @Author:SKEZhi
 * @Create:2024/4/22 - 20:07
 * @Version: v1.0
 */
@Service
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {
    @Override
    public PageInfo<Tag> pageTags(BaseQuery query) {
        PageHelper.startPage(query.getPageNum(), 10);
        PageHelper.orderBy("create_time desc");

        LambdaQueryWrapper<Tag> wrapper = new LambdaQueryWrapper<>();

        List<Tag> list = list();

        return new PageInfo<>(list);

    }

    @Override
    public List<TagVO> listTagsVO() {
        return baseMapper.listTagsVO();
    }
}
